import os

# 获取脚本的绝对路径
script_dir = os.path.dirname(os.path.abspath(__file__))
# 构建目标文件的路径
file_path = os.path.join(script_dir, "text.txt")  # 替换为你的文件路径

try:
    with open(file_path, "r", encoding="utf-8") as file:
        for line in file:
            lineStr = line.strip()  # strip() 去除行末的换行符
            print(lineStr + '-新增')
            print(lineStr + '-修改')
            print(lineStr + '-查看')
except FileNotFoundError:
    print(f"文件不存在: {file_path}")
except Exception as e:
    print(f"读取文件时出错: {e}")
